﻿<Controls:SinacorWindow
    x:Class="Sinacor.UI.Bovespa.Ordens.View.SmartClient.ConsultaOrdensNegocios"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Model="clr-namespace:Sinacor.UI.Bovespa.Ordens.Model;assembly=Sinacor.UI.Bovespa.Ordens.Model"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Edit="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Edit;assembly=Sinacor.Infra.UI.Controls"
    ModuleId = "ORD"
    ModulePlus ="False"
    Title="{DynamicResource Bovespa.Ordens.Label.ConsultaOrdensNegocios}"
    WindowState="Maximized"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">

    <Controls:SinacorExpanderContainer x:Name="expanderContainer">

        <!--Definição de linhas no Container-->
        <Controls:SinacorExpanderContainer.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="4"/>
            <RowDefinition Height="*" MinHeight="105"/>
            <RowDefinition Height="4"/>
            <RowDefinition Height="*" MinHeight="105"/>
        </Controls:SinacorExpanderContainer.RowDefinitions>


        <!--Filtros de Pesquisa-->
        <Controls:SinacorExpander x:Name="exp1" Grid.Row ="0" Header="{DynamicResource Bovespa.Ordens.Label.Pesquisa}" >
            <Grid>
                <Controls:SinacorLabel x:Name="labelData" Content="{DynamicResource Bovespa.Ordens.Label.Data}" Margin="0,25,0,0" Width="45" VerticalAlignment="Top" HorizontalAlignment="Left"  />
                <Controls:SinacorComboBox IsSynchronizedWithCurrentItem="True"  HorizontalAlignment="Left" Width="90.5" IsEditable="False"  x:Name="comboData"    Margin="48,25,0,0"  VerticalAlignment="Top"  SelectionChanged="comboData_SelectionChanged"  IsRequired="True" HeightPopup="250" />

                <Controls:SinacorLabel x:Name="labelPapel" Margin="140,25,0,0" Content="{DynamicResource Bovespa.Ordens.Label.Papel}" Height="Auto" Width="45" VerticalAlignment="Top" HorizontalAlignment="Left" />
                <Controls:SinacorTextBox  x:Name ="textPapel" Margin="188,25,0,0" Width="89" MaxLength="12" VerticalAlignment="Top" HorizontalAlignment="Left" />
                <Controls:SinacorButton x:Name="BtnPesquisaTitulo" Margin="282,25,0,0" Icon="IconButtonSearch" HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="{DynamicResource Bovespa.Ordens.Tooltip.PesquisarAtivo}" Visibility="Visible" Click="BtnPesquisaTitulo_Click" />

                <Controls:SinacorLabel x:Name="labelCliente" Content="{DynamicResource Bovespa.Ordens.Label.Cliente}" Margin="0,50,0,0" Width="45" VerticalAlignment="Top" HorizontalAlignment="Left"/>
                <Controls:SinacorTextBox  x:Name ="textCliente" Margin="48,50,0,0" Width="125" MaxLength="18" HorizontalAlignment="Left" VerticalAlignment="Top" />
                <Controls:SinacorButton x:Name="BtnPesquisaCliente" Margin="179,50,0,0" Icon="IconButtonClient" HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="{DynamicResource Bovespa.Ordens.Tooltip.PesquisarCliente}" Visibility="Visible" Click="BtnPesquisaCliente_Click" />

                <Controls:SinacorLabel x:Name="labelBolsa" Margin="209,50,0,0" Content="{DynamicResource Bovespa.Ordens.Label.Bolsa}" Width="45" VerticalAlignment="Top" HorizontalAlignment="Left" />
                <Controls:SinacorTextBox x:Name ="textBolsa" Margin="257,50,0,0" Text = "" Width="48" MaxLength="2" VerticalAlignment="Top" HorizontalAlignment="Left" />

                <!--GroupBox de Situação de Ordens-->
                <Controls:SinacorGroupBox x:Name="groupSituacaoOrdens" Margin="310,0,0,0" VerticalAlignment="Top" Header="{DynamicResource Bovespa.Ordens.Label.SituacaoOrdens}"  HorizontalAlignment="Left" Height="75" Width="209" >
                    <!--RadioButtons de Situação de Ordens-->
                    <Grid>
                        <Controls:SinacorRadioButton x:Name="radioCasadas" Content="{DynamicResource Bovespa.Ordens.Label.Casadas}" Width = "85" IsChecked="False" IsEnabled="True" IsThreeState="True"  Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="{DynamicResource BrushGridRowBusiness02}"/>
                        <Controls:SinacorRadioButton x:Name="radioTodas" Content="{DynamicResource Bovespa.Ordens.Label.Todas}" Width = "85" IsChecked="True" IsEnabled="True" IsThreeState="True" Margin="0,25,0,0"  HorizontalAlignment="Left" VerticalAlignment="Top" />
                        <Controls:SinacorRadioButton x:Name="radioNaoCasadas" Content="{DynamicResource Bovespa.Ordens.Label.NaoCasadas}" Width="105" IsChecked="False" IsEnabled="True" IsThreeState="True" Margin="89,0,0,0"  HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="{DynamicResource BrushGridRowBusiness06}"/>
                        <Controls:SinacorRadioButton x:Name="radioCasadasParte" Content="{DynamicResource Bovespa.Ordens.Label.CasadasParte}" Width="105" IsChecked="False" IsEnabled="True" IsThreeState="True" Margin="89,25,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="{DynamicResource BrushGridRowBusiness04}"/>
                    </Grid>
                </Controls:SinacorGroupBox>

                <!--GroupBox de Sincronismo-->
                <Controls:SinacorGroupBox x:Name="groupSincronismo" Margin="523,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Header="{DynamicResource Bovespa.Ordens.Label.Sincronismo}"  Width="447" Height="75">
                    <!--RadioButtons de Sincronismo-->
                    <Grid>
                        <Controls:SinacorRadioButton x:Name="radioOrdensNegocios" Content="{DynamicResource Bovespa.Ordens.Label.OrdensxNegocios}" Width = "140"  IsChecked="False" IsEnabled="True" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Checked="radioOrdensNegocios_Checked"   />
                        <Controls:SinacorRadioButton x:Name="radioNegociosOrdens" Content="{DynamicResource Bovespa.Ordens.Label.NegociosxOrdens}" Width = "140"  IsChecked="False" IsEnabled="True" Margin="144,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Checked="radioNegociosOrdens_Checked" />
                        <Controls:SinacorRadioButton x:Name="radioSemSincronismo" Content="{DynamicResource Bovespa.Ordens.Label.SemSincronismo}" Width = "135"  IsChecked="True" IsEnabled="True" Margin="288,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Checked="radioSemSincronismo_Checked"/>
                        <Controls:SinacorCheckBox    x:Name="checkSincronismoAutomatico" Content="{DynamicResource Bovespa.Ordens.Label.SincronismoAutomatico}" Width = "155"  IsChecked="False" IsEnabled="True" Margin="0,25,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                    </Grid>
                </Controls:SinacorGroupBox>

                <!--Botão de Pesquisa-->
                <Controls:SinacorButton x:Name ="BtnPesquisar" Margin="766,79,0,0" Content = "{DynamicResource Bovespa.Ordens.Label.Pesquisar}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" CausesValidation="True" IsDefault = "True" Click ="buttonPesquisar_Click" />
                <Controls:SinacorButton x:Name="BtnNovaPesquisa" Margin="870,79,0,0" Content = "{DynamicResource Bovespa.Ordens.Label.NovaPesquisa}"  HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" Click="BtnNovaPesquisa_Click" />
            </Grid>
        </Controls:SinacorExpander>

        <!--Grid de Ordens-->
        <Controls:SinacorExpander x:Name="exp2" Grid.Row ="2" Header="{DynamicResource Bovespa.Ordens.Label.Ordens}" HorizontalSplitter="{Binding ElementName=sptOrdens}" >

            <Controls:SinacorDataGrid x:Name="datagridOrdens"  AllowDelete="False" ApplyingStyle="datagridOrdens_ApplyingStyle" BufferedSelectionChanged="datagridOrdens_BufferedSelectionChanged" MouseDoubleClick="GridOrdens_DoubleClick">
                <Controls:SinacorDataGrid.Columns>
                    <Controls:Column Name="Operador" DisplayMemberPath="LoginOperador" Title="Bovespa.Ordens.Label.Operador" AllowInsert="False" />
                    <Controls:Column Name="DatadaOrdem" DisplayMemberPath="DataOrdem" HorizontalCellAlignment="Center" Title="Bovespa.Ordens.Label.DataOrdem" AllowInsert="False" />
                    <Controls:Column Name="Numero" DisplayMemberPath="Numero" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.Numero" AllowInsert="False" />
                    <Controls:Column Name="Sequencia" DisplayMemberPath="NumeroOrdemSequencia" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.Sequencia" AllowInsert="False" />
                    <Controls:Column Name="Hora" DisplayMemberPath="HoraOrdemFormatada" HorizontalCellAlignment="Center" Title="Bovespa.Ordens.Label.horaNegocio" AllowInsert="False" />
                    <Controls:Column Name="Mercado" DisplayMemberPath="TipoMercado" Title="Bovespa.Ordens.Label.Mercado" AllowInsert="False" />
                    <Controls:Column Name="CompraVenda" DisplayMemberPath="TipoNaturezaOperacao" HorizontalCellAlignment="Center" Title="Bovespa.Ordens.Label.CompraVenda" AllowInsert="False" />
                    <Controls:Column Name="Papel" DisplayMemberPath="Titulo" Title="Bovespa.Ordens.Label.Papel" AllowInsert="False" />
                    <Controls:Column Name="Apelido" DisplayMemberPath="ApelidoCliente" Title="Bovespa.Ordens.Label.Apelido" AllowInsert="False" />
                    <Controls:Column Name="Quantidade" DisplayMemberPath="Quantidade" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.Quantidade" AllowInsert="False" Decimals="4" Integers="16" StringFormat="n4" />
                    <Controls:Column Name="Saldo" DisplayMemberPath="Saldo" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.Saldo" AllowInsert="False" Decimals="4" Integers="16" StringFormat="n4" />
                    <Controls:Column Name="QuantidadeCasada" DisplayMemberPath="QuantidadeCasada" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.QuantidadeCasada" AllowInsert="False" Decimals="4" Integers="16" StringFormat="n4" />
                    <Controls:Column Name="Bolsa" DisplayMemberPath="Bolsa" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.Bolsa" AllowInsert="False"/>
                    <Controls:Column Name="Preco" DisplayMemberPath="Preco" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.LimitePreco" AllowInsert="False" Decimals="8" Integers="11" StringFormat="n8" />
                    <Controls:Column Name="Ordem" DisplayMemberPath="NumeroOrdemOriginal" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.OrdemOriginal" AllowInsert="False" />
                    <Controls:Column Name="Situacao" DisplayMemberPath="Situacao" HorizontalCellAlignment="Center" Title="Bovespa.Ordens.Label.Situacao" AllowInsert="False"  />
                    <Controls:Column Name="Cliente" DisplayMemberPath="CodigoCliente" HorizontalCellAlignment="Right" Title="Bovespa.Ordens.Label.Cliente" AllowInsert="False"/>
                    <Controls:Column Name="NomeCliente" DisplayMemberPath="NomeCliente" Title="Bovespa.Ordens.Label.NomeCliente" AllowInsert="False"  />
                </Controls:SinacorDataGrid.Columns>
            </Controls:SinacorDataGrid>

        </Controls:SinacorExpander>

        <!--Spliter do Grid de Ordens-->
        <Controls:SinacorHorizontalGridSplitter x:Name="sptOrdens" Grid.Row="3" Height="2" />

        <!--Grid de Negócios-->
        <Controls:SinacorExpander x:Name="exp3" Grid.Row ="4" Header="{DynamicResource Bovespa.Ordens.Label.Negocios}" >

            <Controls:SinacorDataGrid  x:Name="datagridNegocios" AllowDelete="False" Grid.Row="0" ApplyingStyle="datagridNegocios_ApplyingStyle" BufferedSelectionChanged="datagridNegocios_BufferedSelectionChanged"  MouseDoubleClick="GridNegocios_DoubleClick">
                <Controls:SinacorDataGrid.Columns>
                    <Controls:Column Name="Data" DisplayMemberPath="DataMovimento" Title="Bovespa.Ordens.Label.Data" AllowInsert="False" HorizontalCellAlignment="Center" />
                    <Controls:Column Name="Numero" DisplayMemberPath="NumeroNegocio" Title="Bovespa.Ordens.Label.Numero" AllowInsert="False"  HorizontalCellAlignment="Right"/>
                    <Controls:Column Name="Hora" DisplayMemberPath="HoraNegocio" StringFormat="HH:mm" Title="Bovespa.Ordens.Label.horaNegocio" AllowInsert="False"  HorizontalCellAlignment="Center"/>
                    <Controls:Column Name="Mercado" DisplayMemberPath="TipoMercado" Title="Bovespa.Ordens.Label.Mercado" AllowInsert="False"  HorizontalCellAlignment="Left"/>
                    <Controls:Column Name="Papel" DisplayMemberPath="CodigoTitulo" Title="Bovespa.Ordens.Label.Papel" AllowInsert="False"  HorizontalCellAlignment="Left"/>
                    <Controls:Column Name="CompraVenda" DisplayMemberPath="TipoNaturezaOperacao" Title="Bovespa.Ordens.Label.NaturezaOperacao" AllowInsert="False"  HorizontalCellAlignment="Center"/>
                    <Controls:Column Name="Quantidade" DisplayMemberPath="Quantidade" Title="Bovespa.Ordens.Label.Quantidade" AllowInsert="False" HorizontalCellAlignment="Right" Decimals="4" Integers="15" StringFormat="n4" />
                    <Controls:Column Name="Saldo" DisplayMemberPath="Saldo" Title="Bovespa.Ordens.Label.Saldo" AllowInsert="False"  HorizontalCellAlignment="Right" Decimals="4" Integers="15" StringFormat="n4"/>
                    <Controls:Column Name="Preco" DisplayMemberPath="Preco" Title="Bovespa.Ordens.Label.Preco" AllowInsert="False" StringFormat="N8" HorizontalCellAlignment="Right"/>
                    <Controls:Column Name="Cliente" DisplayMemberPath="Cliente" Title="Bovespa.Ordens.Label.Cliente" AllowInsert="False"  HorizontalCellAlignment="Right"/>
                    <Controls:Column Name="Bolsa" DisplayMemberPath="Bolsa" Title="Bovespa.Ordens.Label.Bolsa" AllowInsert="False" HorizontalCellAlignment="Right" />
                    <Controls:Column Name="ContraParte" DisplayMemberPath="ContraParte" Title="Bovespa.Ordens.Label.CP" AllowInsert="False"  HorizontalCellAlignment="Right"/>
                    <Controls:Column Name="TiLiquidacao" DisplayMemberPath="TipoLiquidacao" Title="Bovespa.Ordens.Label.tipoLiquidacao" AllowInsert="False" HorizontalCellAlignment="Left" />
                    <Controls:Column Name="CodigoCorrespondente" DisplayMemberPath="CodigoCorrespondente" Title="Bovespa.Ordens.Label.CorrespondenteCodigo" AllowInsert="False"  HorizontalCellAlignment="Right" />
                    <Controls:Column Name="QuantidadeCasada" DisplayMemberPath="QuantidadeCasada" Title="Bovespa.Ordens.Label.QuantidadeCasada" AllowInsert="False"  HorizontalCellAlignment="Right" Decimals="4" Integers="15" StringFormat="n4"/>
                    <Controls:Column Name="DiasLiquidacao" DisplayMemberPath="DiasLiquidacao" Title="Bovespa.Ordens.Label.DiasLiquidacao" AllowInsert="False"  HorizontalCellAlignment="Right"/>
                    <Controls:Column Name="Operador" DisplayMemberPath="Operador" Title="Bovespa.Ordens.Label.Operador" AllowInsert="False"  HorizontalCellAlignment="Left"/>
                </Controls:SinacorDataGrid.Columns>
            </Controls:SinacorDataGrid>
        </Controls:SinacorExpander>

    </Controls:SinacorExpanderContainer>
</Controls:SinacorWindow>
